import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: { showTabBar: true },
    component: () => import('@/views/Home.vue')
  },
  {
    path: '/category',
    name: 'Category',
    meta: { showTabBar: true },
    component: () => import('@/views/Category.vue')
  },
  {
    path: '/mine',
    name: 'Mine',
    meta: { showTabBar: true },
    component: () => import('@/views/Mine.vue')
  },
  {
    path: '/author/:authorId',
    name: 'Author',
    component: () => import('@/views/Author.vue')
  },
  {
    path: '/article-detail/:articleId',
    name: 'ArticleDetail',
    component: () => import('@/views/ArticleDetail.vue')
  },
  {
    path: '/classify-detail/:id',
    name: 'ClassifyDetail',
    component: () => import('@/views/ClassifyDetail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
